-
Notifications
You must be signed in to change notification settings - Fork 9
Fix memory leak in the timer #334
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
Signed-off-by: Leandro Lucarella <[email protected]>
We were creating two futures, but only awaiting until the one of them finished and not canceling the second. Because `reset()` was never called, we were just creating more and more futures that would never complete. This change fixes this by canceling the second task immediately after the first one is complete. Signed-off-by: Sahas Subramanian <[email protected]>
Signed-off-by: Sahas Subramanian <[email protected]>
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Oh damn! Good catch! I wonder if we are getting any warnings in pytest we are ignoring, because pytest should report leaked futures.
|
I see we have some warnings about pending tasks in the tests: Maybe we should make sure we don't get these anymore and start failing the CI job if we introduce new warnings... |
I had code that would clean up the tasks afterwards, but one of you said it's unnecessary :P |
You lacked marketing. If you have said it was fixing a leak I would have paid more attention 🤣 Anyway, I learned quite a bit from this fantastic experience. |
We were creating two futures, but only awaiting until the one of them
finished and not canceling the second.
Because
reset()was never called, we were just creating more andmore futures that would never complete.
This change fixes this by canceling the second task immediately after
the first one is complete.